package com.example.demo.keygen;

import com.mybatisflex.core.keygen.IKeyGenerator;

import java.security.SecureRandom;

public class HashCodeKeyGenerator implements IKeyGenerator {
    @Override
    public Object generate(Object entity, String keyColumn) {
        return entity.hashCode() + new SecureRandom().nextInt();
    }
}
